package com.fuqiang.nightshopadmin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuqiang.nightshopadmin.mapper.IUmsResourceCategoryMapper;
import com.fuqiang.nightshopadmin.service.IUmsResourceCategoryService;
import com.fuqiang.nightshopumsmodel.entity.UmsResourceCategory;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 资源分类表 服务实现类
 * </p>
 *
 * @author fuqiang
 * @since 2020-04-14
 */
@Service
@AllArgsConstructor
public class UmsResourceCategoryServiceImpl extends ServiceImpl<IUmsResourceCategoryMapper, UmsResourceCategory> implements IUmsResourceCategoryService {

    private IUmsResourceCategoryMapper resourceCategoryMapper;

    @Override
    public List<UmsResourceCategory> listAll() {
        QueryWrapper<UmsResourceCategory> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().orderByDesc(UmsResourceCategory::getSort);
        return resourceCategoryMapper.selectList(queryWrapper);
    }
}
